// 自动生成模板Article
package cms

import (
	"gitcode.com/G-YT/baoyou/server/global"
	"gorm.io/datatypes"
)

// 文章信息 结构体  Article
type Article struct {
	global.GvaModel
	Title        *string        `json:"title" form:"title" gorm:"comment:文章标题;column:title;" binding:"required"`                              //标题
	Author       *string        `json:"author" form:"author" gorm:"comment:文章作者;column:author;"`                                              //作者
	Type         *string        `json:"type" form:"type" gorm:"comment:文章类型;column:type;"`                                                    //文章类型
	Price        *int64         `json:"price" form:"price" gorm:"comment:售价（分）;column:price;"`                                                //售价（分）
	VIP          *bool          `json:"vip" form:"vip" gorm:"comment:是否vip文章;column:vip;"`                                                    //是否vip文章
	Category     *int64         `json:"category" form:"category" gorm:"comment:文章分类;column:category;"`                                        //分类
	Audio        datatypes.JSON `json:"audio" form:"audio" gorm:"comment:音频;column:audio;" swaggertype:"array,object"`                        //音频
	Tags         datatypes.JSON `json:"tags" form:"tags" gorm:"comment:文章标签;column:tags;" swaggertype:"array,object"`                         //标签
	Video        string         `json:"video" form:"video" gorm:"comment:视频;column:video;"`                                                   //视频
	Picture      string         `json:"picture" form:"picture" gorm:"comment:首图;column:picture;"`                                             //首图
	Intro        *string        `json:"intro" form:"intro" gorm:"comment:简介;column:intro;"`                                                   //简介
	KeyPoint     datatypes.JSON `json:"keyPoint" form:"keyPoint" gorm:"comment:使用要点;column:key_point;" swaggertype:"array,object"`            //使用要点
	Instructions datatypes.JSON `json:"instructions" form:"instructions" gorm:"comment:使用须知;column:instructions;" swaggertype:"array,object"` //使用须知
	Content      *string        `json:"content" form:"content" gorm:"comment:文章内容;column:content;type:text;" binding:"required"`              //内容
	Repost       *int64         `json:"repost" form:"repost" gorm:"comment:转发;column:repost;"`                                                //转发
	Views        *int64         `json:"views" form:"views" gorm:"comment:文章浏览次数;column:views;"`                                               //浏览
	Status       *bool          `json:"status" form:"status" gorm:"comment:上架状态;column:status;"`                                              //上架状态
}

// TableName 文章信息 Article自定义表名 by_cms_article
func (Article) TableName() string {
	return "by_cms_article"
}
